#include<bits/stdc++.h>
using namespace std;

#define int long long

const int N = 1e5 + 5;

int n;
int a[N];
int cnt[N];

signed main() {
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);
    cin >> n;
    for (int i = 1; i <= n; i++)
        cin >> a[i];
    for (int i = 1; i <= n; i++)
        cnt[a[i]]++;
    int ans = 0, sum = 0;
    for (int i = 1; i <= 1e5; i++) {
        ans += min(cnt[i], sum);
        sum = max(0ll, sum - cnt[i]);
        sum += cnt[i];
    }
    cout << n - ans;
    return 0;
}

/*
dp, segment tree, hash, kmp, maths, greedy, graph
*/
